let obj = {
    a: 1,
    b: 2,
    c: 3
}
for (let i in obj) {
    console.log(i)
}

// for (let i of obj) {
//     console.log(i) //会报错：bj is not iterable
// }

const arr = ['a', 'b', 'c']
// for in 循环
for (let i in arr) {
    console.log(i)
    // 0
    // 1
    // 2
}

// for of
for (let i of arr) {
    console.log(i)
    // a
    // b
    // c
}

let ddarr = [1, 3, 4]
ddarr.name = "liu"
console.log(ddarr)

ddarr.forEach(item => {
    console.log(item)
})
for (let i of ddarr) {
    console.log(i)
}
for (let i in ddarr) {
    console.log(i)
}